using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;
namespace WaEvent.Generated
{
	#region Tables Struct
	public partial struct Tables
	{
		
		public static readonly string AspnetApplications = @"aspnet_Applications";
        
		public static readonly string AspnetMembership = @"aspnet_Membership";
        
		public static readonly string AspnetPaths = @"aspnet_Paths";
        
		public static readonly string AspnetPersonalizationAllUsers = @"aspnet_PersonalizationAllUsers";
        
		public static readonly string AspnetPersonalizationPerUser = @"aspnet_PersonalizationPerUser";
        
		public static readonly string AspnetProfile = @"aspnet_Profile";
        
		public static readonly string AspnetRoles = @"aspnet_Roles";
        
		public static readonly string AspnetSchemaVersions = @"aspnet_SchemaVersions";
        
		public static readonly string AspnetUsers = @"aspnet_Users";
        
		public static readonly string AspnetUsersInRoles = @"aspnet_UsersInRoles";
        
		public static readonly string AspnetWebEventEvents = @"aspnet_WebEvent_Events";
        
		public static readonly string EventCategory = @"EventCategory";
        
		public static readonly string EventComment = @"EventComment";
        
		public static readonly string Follow = @"Follow";
        
		public static readonly string IEvent = @"iEvent";
        
	}
	#endregion
    #region Schemas
    public partial class Schemas {
		
		public static TableSchema.Table AspnetApplications
		{
            get { return DataService.GetSchema("aspnet_Applications", "WaEvent"); }
		}
        
		public static TableSchema.Table AspnetMembership
		{
            get { return DataService.GetSchema("aspnet_Membership", "WaEvent"); }
		}
        
		public static TableSchema.Table AspnetPaths
		{
            get { return DataService.GetSchema("aspnet_Paths", "WaEvent"); }
		}
        
		public static TableSchema.Table AspnetPersonalizationAllUsers
		{
            get { return DataService.GetSchema("aspnet_PersonalizationAllUsers", "WaEvent"); }
		}
        
		public static TableSchema.Table AspnetPersonalizationPerUser
		{
            get { return DataService.GetSchema("aspnet_PersonalizationPerUser", "WaEvent"); }
		}
        
		public static TableSchema.Table AspnetProfile
		{
            get { return DataService.GetSchema("aspnet_Profile", "WaEvent"); }
		}
        
		public static TableSchema.Table AspnetRoles
		{
            get { return DataService.GetSchema("aspnet_Roles", "WaEvent"); }
		}
        
		public static TableSchema.Table AspnetSchemaVersions
		{
            get { return DataService.GetSchema("aspnet_SchemaVersions", "WaEvent"); }
		}
        
		public static TableSchema.Table AspnetUsers
		{
            get { return DataService.GetSchema("aspnet_Users", "WaEvent"); }
		}
        
		public static TableSchema.Table AspnetUsersInRoles
		{
            get { return DataService.GetSchema("aspnet_UsersInRoles", "WaEvent"); }
		}
        
		public static TableSchema.Table AspnetWebEventEvents
		{
            get { return DataService.GetSchema("aspnet_WebEvent_Events", "WaEvent"); }
		}
        
		public static TableSchema.Table EventCategory
		{
            get { return DataService.GetSchema("EventCategory", "WaEvent"); }
		}
        
		public static TableSchema.Table EventComment
		{
            get { return DataService.GetSchema("EventComment", "WaEvent"); }
		}
        
		public static TableSchema.Table Follow
		{
            get { return DataService.GetSchema("Follow", "WaEvent"); }
		}
        
		public static TableSchema.Table IEvent
		{
            get { return DataService.GetSchema("iEvent", "WaEvent"); }
		}
        
	
    }
    #endregion
    #region View Struct
    public partial struct Views 
    {
		
		public static readonly string VwAspnetApplications = @"vw_aspnet_Applications";
        
		public static readonly string VwAspnetMembershipUsers = @"vw_aspnet_MembershipUsers";
        
		public static readonly string VwAspnetProfiles = @"vw_aspnet_Profiles";
        
		public static readonly string VwAspnetRoles = @"vw_aspnet_Roles";
        
		public static readonly string VwAspnetUsers = @"vw_aspnet_Users";
        
		public static readonly string VwAspnetUsersInRoles = @"vw_aspnet_UsersInRoles";
        
		public static readonly string VwAspnetWebPartStatePaths = @"vw_aspnet_WebPartState_Paths";
        
		public static readonly string VwAspnetWebPartStateShared = @"vw_aspnet_WebPartState_Shared";
        
		public static readonly string VwAspnetWebPartStateUser = @"vw_aspnet_WebPartState_User";
        
    }
    #endregion
    
    #region Query Factories
	public static partial class DB
	{
        public static DataProvider _provider = DataService.Providers["WaEvent"];
        static ISubSonicRepository _repository;
        public static ISubSonicRepository Repository 
        {
            get 
            {
                if (_repository == null)
                    return new SubSonicRepository(_provider);
                return _repository; 
            }
            set { _repository = value; }
        }
        public static Select SelectAllColumnsFrom<T>() where T : RecordBase<T>, new()
	    {
            return Repository.SelectAllColumnsFrom<T>();
	    }
	    public static Select Select()
	    {
            return Repository.Select();
	    }
	    
		public static Select Select(params string[] columns)
		{
            return Repository.Select(columns);
        }
	    
		public static Select Select(params Aggregate[] aggregates)
		{
            return Repository.Select(aggregates);
        }
   
	    public static Update Update<T>() where T : RecordBase<T>, new()
	    {
            return Repository.Update<T>();
	    }
	    
	    public static Insert Insert()
	    {
            return Repository.Insert();
	    }
	    
	    public static Delete Delete()
	    {
            return Repository.Delete();
	    }
	    
	    public static InlineQuery Query()
	    {
            return Repository.Query();
	    }
	    	    
	    
	}
    #endregion
    
}
#region Databases
public partial struct Databases 
{
	
	public static readonly string WaEvent = @"WaEvent";
    
}
#endregion